<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		{include file="Public/header"}

		<link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
		<link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
		<script src="__STATIC__/layout/js/jquery.min.js"></script>
		<style type="text/css">
			.handup {
				color: #a6e1fc;
				display: inline-block;
				padding-left: 10px;
				cursor: pointer;
			}
			
			.btn-white.active {
				color: #fff;
				background-color: #337ab7;
			}
			
			.tabdiv {
				display: none;
			}
			
			.tabdivActive {
				display: block;
			}
			
			.signatureImg {
				width: 100px;
				height: 34px;
				display: inline-block;
				vertical-align: middle;
				border: 1px solid #ccc;
			}
			
			.titleImg {
				width: 20px;
				height: 20px;
				margin-right: 8px;
				display: inline-block;
				vertical-align: middle;
			}
			
			.table {
				margin-bottom: 10px;
			}
			
			.pImg {
				padding: 4px;
			}
			.imgShow img{
				width: 160px;
				height: 60px;
			}
		</style>
	</head>

	<body style="padding: 3px;">
		<div class="page-heade">
			<h2 class="title_color text-center">销售费用申请</h2>
			<input type="hidden" id="aid" value="{$yw_id}"/>
		</div>
		<table class="table table-bordered">
			<tr>
				<td>活动主题</td>
				<td colspan="3">{$apply['title']}</td>
				<td>活动编号</td>
				<td>{$apply['sn']}</td>
				<td>活动经销商</td>
				<td>{$apply['jxs']}</td>
			</tr>
			<tr>
				<td>是否进货 </td>
				<td> {if condition="$apply['is_jinhuo'] eq 1"} 进货1{else/}不进货0 {/if}</td>
				<td>进货时段</td>
				<td style="width: 160px;">{if condition="$apply['is_jinhuo'] eq 1"} {$apply['jinhuo_shijian_start']} 至 {$apply['jinhuo_shijian_end']} {else/}{/if}</td>
				<td>承诺进货额</td>
				<td>{$apply['jinhuo_jine']} </td>
				<td>预计进货费比</td>
				<td id="yjjhfb">{if condition="$apply['is_jinhuo'] eq 1"}{/if}</td>
			</tr>
		</table>

		{if condition="$apply['is_jinhuo'] eq 1"}
		<script>
            var jinhuo_jine ="{$apply['jinhuo_jine']}";
            if(jinhuo_jine>0){
                var hanshuis = "{$all['hanshuis']}";
                var yjjhfb =parseFloat(100*hanshuis/jinhuo_jine);
                $('#yjjhfb').append(yjjhfb);
            }
		</script>
		{/if}
		<div class="padding-10">
			<button class="btn btn-success" type="button"><i class="fa fa-file"></i>&nbsp;&nbsp;导出Excel</button>
		</div>
		<div style="margin: 10px 0 5px" id="tabA">
			<a href="javascript:;" class="btn btn-info">基本信息</a>
			<a href="javascript:;" class="btn btn-info btn-outline">详细信息</a>
			<a href="javascript:;" class="btn btn-info btn-outline">审批信息</a>
			<a href="javascript:;" class="btn btn-info btn-outline">相关活动</a>
			<a href="javascript:;" class="btn btn-info btn-outline">经销商决策宝</a>
			<a href="javascript:;" class="btn btn-info btn-outline">预算决策宝</a>
			<!--<a href="javascript:;" class="btn btn-info btn-outline">预警提示<span class="badge colorRed">3</span></a>-->
			<span style="float: right;">金额单位：元</span>
		</div>

		<div id="tabbox" style="width: 100%;overflow: hidden">
			<!--基本信息内容-->
			<div class="tabdiv tabdivActive">
				<table class="table table-bordered table-striped">
					<thead>
						<tr class="info">
							<th class="text-center">活动期间</th>
							<th class="text-center">活动描述</th>
							<th class="text-center">活动产品</th>
							<th class="text-center">活动系统名/网点数</th>
							<th class="text-center">费用类型</th>
							<th class="text-center">费用额(含税)</th>
							<th class="text-center">支付方式</th>
							<th class="text-center">费用说明</th>
							<th class="text-center">不做活动销量</th>
							<th class="text-center">做活动销量</th>
							<th class="text-center">费用率</th>
							<th class="text-center">ROI</th>
						</tr>
					</thead>
					<tbody>
					{volist name="applyde" id="vo"}
						<tr>
							<td>
								<p>{$vo['start']}</p>
								<p>{$vo['end']}</p>
								<p>共{$vo['daynum']}天</p>
							</td>
							<td><span>{$vo['brief']}</span><br>
								<a href="javascript:;" title="点击打开详情" data-toggle="modal" data-target=".bs-example-modal-lg">201806060003_80000015</a>
							</td>
							<td>
								{volist name="vo['cp_name']" id="vo2"}
								<p class="proName">{$vo2}</p>
								{/volist}
								<p class="spanTotal" data-toggle="tooltip" data-placement="bottom">共<span>{$vo['cp_num']}</span>个 {$vo['cp_type']}</p>
								<!--<p class="proName">40克舒爽爱牙乐儿童牙膏草莓味</p>
								<p class="proName">40克舒爽爱牙乐儿童牙膏草莓味</p>
								<p class="spanTotal" data-toggle="tooltip" data-placement="bottom" title="">共<span>2</span>个单品</p>-->
							</td>
							<td>
								{$vo['kh']}
								<!--<p>长沙沃尔玛/<span>4</span>家</p>
								<p class="spanTotal" data-toggle="tooltip" data-placement="bottom" title="">共<span>1</span>个系统</p>-->
							</td>
							{volist name="vo['fee']" id="vo3" key="k"}
							{if $k==1}
							<td>{$vo3['title']} </td>
							<td class="text-right">{$vo3['hanshuis']}</td>
							<td>{$vo3['payname']}</td>
							<td>{$vo3['feiyongmiaoshu']}</td>
							{/if}
							{/volist}

							<!--<td>样酒</td>
							<td class="text-right">23213.00</td>
							<td>事后货补</td>
							<td></td>-->
							<td class="text-right">{$vo['noSales']}</td>
							<td class="text-right">{$vo['yesSales']}</td>
							<td class="text-right">{$vo['feiyonglv']}%</td>
							<td class="text-right">{$vo['roi']}%</td>
						</tr>
					{/volist}
					</tbody>
					<tfoot>
						<tr class="trTotal text-right">
							<td colspan="5">合计</td>
							<td>{$all['hanshuis']}</td>
							<td></td>
							<td></td>
							<td>{$all['noSales']}</td>
							<td>{$all['yesSales']}</td>
							<td>{$all['feiyonglv']}</td>
							<td>0.00%</td>
						</tr>
					</tfoot>
				</table>

			</div>
			<!--详细信息内容-->
			<div class="tabdiv">
				<div style="overflow-x: auto;margin-bottom: 10px">
					<table class="table table-striped table-bordered table-hover text-center bud_hei">
						<thead>
							<tr class="info">
								<th class="text-center" style="min-width: 80px">状态</th>
								<th class="text-center" style="min-width: 80px">明细编号</th>
								<th class="text-center" style="min-width: 190px">经销商名称</th>
								<th class="text-center" style="min-width: 190px">活动执行时间</th>
								<th class="text-center" style="min-width: 120px">预计核销时间</th>
								<th class="text-center" style="min-width: 80px">产品类型</th>
								<th class="text-center" style="min-width: 190px">产品名称</th>
								<th class="text-center" style="min-width: 110px">三级费用科目</th>
								<th class="text-center" style="min-width: 80px">支付方式</th>
								<th class="text-center" style="min-width: 80px">未税金额</th>
								<th class="text-center" style="min-width: 120px">是否增值税<br>（可抵扣）</th>
								<th class="text-center" style="min-width: 80px">税率</th>
								<th class="text-center" style="min-width: 80px">含税金额</th>
								<th class="text-center" style="min-width: 110px">实际投入费用</th>
								<th class="text-center" style="min-width: 80px">已核销费用</th>
								<th class="text-center" style="min-width: 80px">费用说明</th>
								<th class="text-center" style="min-width: 80px">做活动销量</th>
								<th class="text-center" style="min-width: 80px">预计费用率</th>
								<th class="text-center" style="min-width: 80px">实际销量</th>
								<th class="text-center" style="min-width: 80px">ROI</th>
								<th class="text-center" style="min-width: 80px">活动简述</th>
								<th class="text-center" style="min-width: 80px">成本中心</th>
								<th class="text-center" style="min-width: 80px">陈列类型</th>
								<th class="text-center" style="min-width: 80px">陈列位置</th>
								<th class="text-center" style="min-width: 80px">陈列尺寸</th>
								<th class="text-center" style="min-width: 240px">收款方</th>
							</tr>
						</thead>
						<tbody>
						{volist name="xxxx" id="vot"}
							<tr>
								<td class="text-center">
									<p>正常</p>
								</td>
								<td  class="text-right">
									<p>{$vot['sn']}</p>
								</td>
								<td  class="text-right">{$vot['title']}</td>
								<td  class="text-right">
									<p>{$vot['zxtime']}</p>
								</td>
								<td  class="text-right">
									<p>{$vot['expCanTime']}</p>
								</td>
								<td  class="text-right">{$vot['cp_type']}</td>
								<td class="text-right">{$vot['cp_name']}</td>
								<td>{$vot['feetype']}</td>
								<td class="text-right">{$vot['paymethod']}</td>
								<td class="text-right"> {$vot['amount']}</td>
								<td class="text-right">是</td>
								<td class="text-right"> {$vot['shuilv']}%</td>
								<td class="text-right">{$vot['hanshui']}</td>
								<td class="text-right">{$vot['yjsjtrfy']}</td>
								<td class="text-right">{$vot['hx_yihexiao2']}</td>
								<td class="text-right">{$vot['feiyongmiaoshu']}</td>
								<td class="text-right">{$vot['hdxl']}</td>
								<td class="text-right">{$vot['yjfyl']}</td>
								<td class="text-right">{$vot['shijixiaoliang']}</td> <!--实际销量-->
								<td class="text-right">{$vot['yujiroi']}%</td>
								<td class="text-right">{$vot['brief']}</td>
								<td class="text-right">{$vot['cb_name']}</td>
								<td class="text-right">{$vot['cl_type']}</td>
								<td class="text-right">{$vot['cl_place']}</td>
								<td class="text-right">{$vot['cl_size']}</td>
								<td class="text-right">{$vot['payeetype']}:{$vot['payee']}</td>

							</tr>
						{/volist}
						</tbody>
					</table>

				</div>

			</div>
			<!--审批信息内容-->
			<div class="tabdiv">
				<table class="table table-bordered table-striped text-center">
					<thead>
						<tr class="info">
							<th class="text-center">签名</th>
							<th class="text-center">审批人</th>
							<th class="text-center">审批人职务</th>
							<th class="text-center">审批动作</th>
							<th style="width: 30%;">审批意见</th>
							<th class="text-center">审批时间</th>
						</tr>
					</thead>
					<tbody>
					{volist name="logs" id="row"}
						<tr>
							<td><img src="" alt="" class="signatureImg"></td>
							<td>{$row.USERNAME}</td>
							<td>{$row.depart}-{$row.job}</td>
							<td>{$row.MEMO}</td>
							<td>{$row.COMMENTS}</td>
							<td>{$row.ACTIONTIME}</td>
						</tr>
					{/volist}
					</tbody>
				</table>

			</div>
			<!--相关活动内容-->
			<div class="tabdiv">
				<div class="padding-10">
					<span class="font-bold">决策时段：</span>
					<select name="" id="xgcainian" class="form-control nian" style="width: 140px;margin-right: 5px; display: inline-block;">
						{volist name='cainian' id="vo"}
						<option value="{$vo.id}" {if $vo.id==$cid} selected {/if}>{$vo.title}</option>
						{/volist}
					</select>
					<select name="" id="xgk2s" class="form-control yues" style="width: 140px;margin-right: 5px; display: inline-block;">
						{volist name='kaohe2' id="vo"}
						<option value="{$vo.id}" {if $vo.id==$k2id} selected {/if}>{$vo.title}</option>
						{/volist}
					</select>
					至
					<select name="" id="xgk2e" class="form-control yuee" style="width: 140px;margin-right: 5px; display: inline-block;">
						{volist name='kaohe2' id="vo"}
						<option value="{$vo.id}" {if $vo.id==$k2id} selected {/if}>{$vo.title}</option>
						{/volist}
					</select>
					<input type="button" class="btn btn-info" value="查询" id="xiangguanck" />
				</div>
				<script type="text/javascript">
				$("#xiangguanck").click(function(){
					var aid=$("#aid").val();
					var cid=$("#xgcainian").val();
					var k2s=$("#xgk2s").val();
					var k2e=$("#xgk2e").val();
					$.post("{:url('getxg')}",{aid:aid,cid:cid,k2s:k2s,k2e:k2e},function(re){
						var data=JSON.parse(re)
						$("#thisCity>table>tbody").html('');
						$("#thisCustom>table>tbody").html('');
						$("#thisAppler>table>tbody").html('');
						for(var i=0;i<data.length;i++){
							var str="<tr><td>"+data[i]["city"]+"</td><td>"+data[i]["jxs"]+"</td><td><a href='javascript:;'>"+data[i]["sn"]+"</a></td><td>"+data[i]["title"]+"</td><td>"+data[i]["status"]+"</td><td>"+data[i]["kemu"]+"</td><td class='text-right'>"+data[i]["feiyonge"]+"</td><td class='text-right'>"+data[i]["feiyonglv"]+"%</td><td class='text-right'>"+data[i]["roi"]+"%</td></tr>";
							if(data[i]["type"]==1){
								$("#thisCity>table>tbody").append(str)
							}else if(data[i]["type"]==2){
								$("#thisCustom>table>tbody").append(str)
							}else{
								$("#thisAppler>table>tbody").append(str)
							}

						}
					})
				})
				</script>
				<div class="padding-10">
					<ul class="nav nav-tabs" role="tablist">
						<li role="presentation" class="active">
							<a href="#thisCity" aria-controls="home" role="tab" data-toggle="tab">本城市最近活动</a>
						</li>
						<li role="presentation">
							<a href="#thisCustom" aria-controls="profile" role="tab" data-toggle="tab">本客户最近活动</a>
						</li>
						<li role="presentation">
							<a href="#thisAppler" aria-controls="messages" role="tab" data-toggle="tab">申请人最近活动</a>
						</li>
					</ul>

					<!-- Tab panes -->
					<div class="tab-content">
						<div role="tabpanel" class="tab-pane active" id="thisCity">
							<table class="table table-bordered">
								<thead>
									<tr class="info">
										
										<th>城市</th>
										<th>经销商</th>
										<th>活动编号</th>
										<th>活动主题</th>
										<th>状态</th>
										<th>费用科目</th>
										<th>费用额</th>
										<th>费用率</th>
										<th>ROI</th>
									</tr>
								</thead>
								<tbody>
								{volist name="nearhuodong" id="row"}
									{if $row.type==1}
										<tr>
											
											<td>{$row.city}</td>
											<td>{$row.jxs}</td>
											<td>
												<a href="javascript:;">{$row.sn}</a>
											</td>
											<td>{$row.title}</td>
											<td>{$row.status}</td>
											<td>
												{$row.kemu}
											</td>
											<td class="text-right">{$row.feiyonge}</td>
											<td class="text-right">{$row.feiyonglv}%</td>
											<td class="text-right">{$row.roi}%</td>
										</tr>
									{/if}
								{/volist}
									
								</tbody>
							</table>
						</div>
						<div role="tabpanel" class="tab-pane" id="thisCustom">
							<table class="table table-bordered">
								<thead>
									<tr class="info">
										
										<th>城市</th>
										<th>经销商</th>
										<th>活动编号</th>
										<th>活动主题</th>
										<th>状态</th>
										<th>费用科目</th>
										<th>费用额</th>
										<th>费用率</th>
										<th>ROI</th>
									</tr>
								</thead>
								<tbody>
									{volist name="nearhuodong" id="row" }
									{if $row.type==2}
										<tr>
										
											<td>{$row.city}</td>
											<td>{$row.jxs}</td>
											<td>
												<a href="javascript:;">{$row.sn}</a>
											</td>
											<td>{$row.title}</td>
											<td>{$row.status}</td>
											<td>
												{$row.kemu}
											</td>
											<td class="text-right">{$row.feiyonge}</td>
											<td class="text-right">{$row.feiyonglv}%</td>
											<td class="text-right">{$row.roi}%</td>
										</tr>
									{/if}
								{/volist}
								</tbody>
							</table>
						</div>
						<div role="tabpanel" class="tab-pane" id="thisAppler">
							<table class="table table-bordered">
								<thead>
									<tr class="info">
										
										<th>城市</th>
										<th>经销商</th>
										<th>活动编号</th>
										<th>活动主题</th>
										<th>状态</th>
										<th>费用科目</th>
										<th>费用额</th>
										<th>费用率</th>
										<th>ROI</th>
									</tr>
								</thead>
								<tbody>

									{volist name="nearhuodong" id="row" }
									
									{if $row.type==3}
									
										<tr>
											
											<td>{$row.city}</td>
											<td>{$row.jxs}</td>
											<td>
												<a href="javascript:;">{$row.sn}</a>
											</td>
											<td>{$row.title}</td>
											<td>{$row.status}</td>
											<td>
												{$row.kemu}
											</td>
											<td class="text-right">{$row.feiyonge}</td>
											<td class="text-right">{$row.feiyonglv}%</td>
											<td class="text-right">{$row.roi}%</td>
										</tr>
									{/if}
								{/volist}
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
			<!--经销商决策宝-->
			<div class="tabdiv">
				<div class="padding-10">
					<span class="font-bold">决策时段：</span>
					<select name="" id="jxcainian" class="form-control nian" style="width: 140px;margin-right: 5px; display: inline-block;">
						{volist name='cainian' id="vo"}
						<option value="{$vo.id}" {if $vo.id==$cid} selected {/if}>{$vo.title}</option>
						{/volist}
					</select>
					<select name="" id="jxk2s" class="form-control yues" style="width: 140px;margin-right: 5px; display: inline-block;">
						{volist name='kaohe2' id="vo"}
						<option value="{$vo.id}" {if $vo.id==$k2id} selected {/if}>{$vo.title}</option>
						{/volist}
					</select>
					至
					<select name="" id="jxk2e" class="form-control yuee" style="width: 140px;margin-right: 5px; display: inline-block;">
						{volist name='kaohe2' id="vo"}
						<option value="{$vo.id}" {if $vo.id==$k2id} selected {/if}>{$vo.title}</option>
						{/volist}
					</select>
					<input type="button" class="btn btn-info" id="jxscx" value="查询" />
					<script type="text/javascript">
					$(".nian").change(function(){
						var nian=$(this);
						$.post("{:url('niantok2')}",{cid:$(this).val()},function(re){
							nian.next().html('')
							nian.next().next().html('')
							var data=JSON.parse(re);
							for(var i=0;i<data.length;i++){
								nian.next().append("<option value='"+data[i]["id"]+"'>"+data[i]["title"]+"</option>")
								nian.next().next().append("<option value='"+data[i]["id"]+"'>"+data[i]["title"]+"</option>")
							}

						})
					})
					$("#jxscx").click(function(){
						var aid=$("#aid").val();
						var cid=$("#jxcainian").val();
						var k2s=$("#jxk2s").val();
						var k2e=$("#jxk2e").val();
						$.post("{:url('jxsjc1')}",{aid:aid,cid:cid,k2s:k2s,k2e:k2e},function(re){
							var data=JSON.parse(re)
							var str="<tr><td>"+data["tr"]+"</td><td>"+data["sjxl"]+"</td><td>"+data["dacheng"]+"%</td><td>"+data["ys"]+"</td><td>"+data["yiyong"]+"</td><td>"+data["mbfyl"]+"%</td><td>"+data["sjfyl"]+"%</td></tr>";
							$("#jc1").html(str);
						})
						$.post("{:url('jxsjc2')}",{aid:aid,cid:cid,k2s:k2s,k2e:k2e},function(re){
							$("#jc2").html('');
							var data=JSON.parse(re)
							for(var i=0;i<data.length;i++){
								var str="<tr><td>"+data[i]["k2title"]+"</td><td>"+data[i]["tar"]+"</td><td>"+data[i]["sjxl"]+"</td><td>"+data[i]["dacheng"]+"%</td><td>"+data[i]["ys"]+"</td><td>"+data[i]["yiyong"]+"</td><td>"+data[i]["mbfyl"]+"%</td><td>"+data[i]["sjfyl"]+"%</td></tr>";
								$("#jc2").append(str)
							}
						})
					})
					</script>
				</div>
				<div class="padding-10">
					<i class="fa fa-archive info" style="color: #0066FF;"></i>&nbsp;&nbsp;<span class="font-bold">销量与费用统计</span>
					<table class="table table-bordered" style="margin-top:5px">
						<thead>
							<tr class="info">
								<th class="text-center">目标销量</th>
								<th class="text-center">实际销量</th>
								<th class="text-center">达成率</th>
								<th class="text-center">费用预算</th>
								<th class="text-center">已用费用</th>
								<th class="text-center">目标费用率</th>
								<th class="text-center">实际费用率</th>
							</tr>
						</thead>
						<tbody id="jc1">
							<tr>
								<td>{$jxsjc1.tr}</td>
								<td>{$jxsjc1.sjxl}</td>
								<td>{$jxsjc1.dacheng}%</td>
								<td>{$jxsjc1.ys}</td>
								<td>{$jxsjc1.yiyong}</td>
								<td>{$jxsjc1.mbfyl}%</td>
								<td>{$jxsjc1.sjfyl}%</td>
							</tr>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="7"><i>注：已用费用为该经销商已申请</i></td>
							</tr>
						</tfoot>
					</table>
				</div>
				<div class="padding-10">
					<i class="fa fa-archive info" style="color: #0066FF;"></i>&nbsp;&nbsp;<span class="font-bold">本次申请费用</span>
					<table class="table table-bordered" style="margin-top:5px">
						<thead>
							<tr class="info">
							{volist name="kemu" id="row"}
								<th class="text-center">{$row.title}</th>
							{/volist}
								<th class="text-center">合计费用</th>
								<th class="text-center">审批后费用率</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								{volist name="kemu" id="row"}
								<th class="text-center">{$row.fy}</th>
								{/volist}
								<td class="text-center">{$all['hanshuis']}</td>
								<td class="text-center">{$all['feiyonglv']}</td>
							</tr>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="7"><i>注：实际费用率大于预计费用率显示红色</i></td>
							</tr>
						</tfoot>
					</table>
				</div>
				<div class="padding-10">
					<i class="fa fa-archive info" style="color: #0066FF;"></i>&nbsp;&nbsp;<span class="font-bold">销量与费用明细</span>
					<table class="table table-bordered" style="margin-top:5px">
						<thead>
							<tr class="info">
								<th class="text-center">二级考核期</th>
								<th class="text-center">目标销量</th>
								<th class="text-center">实际销量</th>
								<th class="text-center">达成率</th>
								<th class="text-center">费用预算</th>
								<th class="text-center">已用费用</th>
								<th class="text-center">目标费用率</th>
								<th class="text-center">实际费用率</th>
							</tr>
						</thead>
						<tbody id="jc2">
						{volist name="jxsjc2" id="row"}
							<tr>
								<td>{$row.k2title}</td>
								<td>{$row.tar}</td>
								<td>{$row.sjxl}</td>
								<td>{$row.dacheng}%</td>
								<td>{$row.ys}</td>
								<td>{$row.yiyong}</td>
								<td>{$row.mbfyl}%</td>
								<td>{$row.sjfyl}%</td>
							</tr>
						{/volist}
						</tbody>
						<tfoot>
							<tr>
								<td colspan="8"><i>注：实际费用率大于预计费用率显示红色</i></td>
							</tr>
						</tfoot>
					</table>
				</div>

			</div>
			<!--预算决策宝-->
			<div class="tabdiv">
				<div class="padding-10">
					<div style="display: inline-block;width: 10%;" class="font-bold">
						查看维度：
					</div>
					<ul class="nav nav-tabs" role="tablist" style="width: 40%;display: inline-block;">
						<li role="presentation">
							<a href="#YTD" aria-controls="home" role="tab" data-toggle="tab">YTD</a>
						</li>
						<li role="presentation" class="active">
							<a href="#useYear" aria-controls="profile" role="tab" data-toggle="tab">按财年</a>
						</li>
						<li role="presentation">
							<a href="#useAssessment" aria-controls="messages" role="tab" data-toggle="tab">按考核期</a>
						</li>
					</ul>
					<div style="width: 20%;display: inline-block;" class="text-danger">
						申请时已超预算
					</div>
					<div class="tab-content">
						<div role="tabpanel" class="tab-pane" id="YTD">
							<table class="table table-bordered">
									<thead>
										<tr class="info">
											<th class="text-center">考核期</th>
											<th class="text-center">经销商</th>
											<th class="text-center">品类</th>
											<th class="text-center">一级科目</th>
											<th class="text-center">三级科目</th>
											<th class="text-center">预算金额</th>
											<th class="text-center">已批复金额</th>
											<th class="text-center">未使用金额</th>
											<th class="text-center">申请中金额</th>
											<th class="text-center">本次申请金额</th>
											<th class="text-center">红绿灯</th>
										</tr>
									</thead>
									<tbody>
										<tr>
											<td>1月至8月</td>
											<td>指掌云有限公司</td>
											<td>葵花籽油</td>
											<td>销售费用</td>
											<td>随货折扣费</td>
											<td>0</td>
											<td>0</td>
											<td>0</td>
											<td>22,351.66</td>
											<td>18,240</td>
											<td>
												<div class="imgShow">
														<img src="__STATIC__/layout/css/img/yellow.png" alt="" />
												</div>
											</td>
										</tr>
									</tbody>
									<tfoot>
										<tr>
											<td colspan="11"><i>注：红灯表示已批复金额大于预算金额，黄灯表示未使用金额小于申请中金额，绿灯表示未使用金额大于等于申请中金额。</i></td>
										</tr>
									</tfoot>
							</table>
						</div>
						<div role="tabpanel" class="tab-pane active" id="useYear">
							<table class="table table-bordered">
									<thead>
										<tr class="info">
											<th class="text-center">考核期</th>
											<th class="text-center">经销商</th>
											<th class="text-center">品类</th>
											<th class="text-center">一级科目</th>
											<th class="text-center">三级科目</th>
											<th class="text-center">预算金额</th>
											<th class="text-center">已批复金额</th>
											<th class="text-center">未使用金额</th>
											<th class="text-center">申请中金额</th>
											<th class="text-center">本次申请金额</th>
											<th class="text-center">红绿灯</th>
										</tr>
									</thead>
									<tbody>
										<tr>
											<td>2018</td>
											<td>指掌云有限公司</td>
											<td>葵花籽油</td>
											<td>销售费用</td>
											<td>随货折扣费</td>
											<td>0</td>
											<td>0</td>
											<td>0</td>
											<td>22,351.66</td>
											<td>18,240</td>
											<td>
												<div class="imgShow">
														<img src="__STATIC__/layout/css/img/yellow.png" alt="" />
												</div>
											</td>
										</tr>
									</tbody>
									<tfoot>
										<tr>
											<td colspan="11"><i>注：红灯表示已批复金额大于预算金额，黄灯表示未使用金额小于申请中金额，绿灯表示未使用金额大于等于申请中金额。</i></td>
										</tr>
									</tfoot>
							</table>
						</div>
						<div role="tabpanel" class="tab-pane" id="useAssessment">
							<table class="table table-bordered">
									<thead>
										<tr class="info">
											<th class="text-center">考核期</th>
											<th class="text-center">经销商</th>
											<th class="text-center">品类</th>
											<th class="text-center">一级科目</th>
											<th class="text-center">三级科目</th>
											<th class="text-center">预算金额</th>
											<th class="text-center">已批复金额</th>
											<th class="text-center">未使用金额</th>
											<th class="text-center">申请中金额</th>
											<th class="text-center">本次申请金额</th>
											<th class="text-center">红绿灯</th>
										</tr>
									</thead>
									<tbody>
										<tr>
											<td>8月</td>
											<td>指掌云有限公司</td>
											<td>葵花籽油</td>
											<td>销售费用</td>
											<td>随货折扣费</td>
											<td>0</td>
											<td>0</td>
											<td>0</td>
											<td>22,351.66</td>
											<td>18,240</td>
											<td>
												<div class="imgShow">
													<img src="__STATIC__/layout/css/img/yellow.png" alt="" />
												</div>
											</td>
										</tr>
									</tbody>
									<tfoot>
										<tr>
											<td colspan="11"><i>注：红灯表示已批复金额大于预算金额，黄灯表示未使用金额小于申请中金额，绿灯表示未使用金额大于等于申请中金额。</i></td>
										</tr>
									</tfoot>
							</table>
						</div>
					</div>
				</div>
			</div>
			<!--预警提示-->
				<div class="tabdiv">
						<div class="padding-10">
					<i class="fa fa-archive" style="color: #0066FF;"></i>&nbsp;&nbsp;<span class="font-bold">重复活动</span>
					<table class="table table-bordered" style="margin-top:5px">
						<thead>
							<tr class="info">
								<th colspan="7" class="text-center">重复活动详情</th>
								<th colspan="2" class="text-center">本次活动详情</th>
							</tr>
							<tr class="info">
								<th class="text-center">原活动编码</th>
								<th class="text-center">状态</th>
								<th class="text-center">客户</th>
								<th class="text-center">产品</th>
								<th class="text-center">费用科目</th>
								<th class="text-center">费用额</th>
								<th class="text-center">活动期间</th>
								<th class="text-center">费用额</th>
								<th class="text-center">活动期间</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td><a href="javascript:;">201809050006</a></td>
								<td>拆分人审批</td>
								<td>指掌云公司</td>
								<td>西部人纯葵花籽油1L</td>
								<td>随货折扣费</td>
								<td class="text-right">8,325</td>
								<td>2018-08-30至2018-09-13</td>
								<td class="text-right">15,000</td>
								<td>2018-08-30至2018-09-06</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="padding-10">
					<i class="fa fa-archive info" style="color: #0066FF;"></i>&nbsp;&nbsp;<span class="font-bold">拆开活动-按科目</span>
					<table class="table table-bordered" style="margin-top:5px">
						<thead>
							<tr class="info">
								<th colspan="7" class="text-center">拆开活动详情</th>
								<th colspan="3" class="text-center">本次活动详情</th>
							</tr>
							<tr class="info">
								<th class="text-center">原活动编码</th>
								<th class="text-center">状态</th>
								<th class="text-center">客户</th>
								<th class="text-center">产品</th>
								<th class="text-center">费用科目</th>
								<th class="text-center">费用额</th>
								<th class="text-center">活动期间</th>
								<th class="text-center">产品</th>
								<th class="text-center">费用额</th>
								<th class="text-center">活动期间</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td><a href="javascript:;">201809050006</a></td>
								<td>拆分人审批</td>
								<td>指掌云公司</td>
								<td>西部人纯葵花籽油1L</td>
								<td>随货折扣费</td>
								<td class="text-right">8,325</td>
								<td>2018-08-30至2018-09-13</td>
								<td>西部人纯葵花籽油1L</td>
								<td class="text-right">15,000</td>
								<td>2018-08-30至2018-09-06</td>
							</tr>
						</tbody>
					</table>
				</div>
					<div class="padding-10">
					<i class="fa fa-archive info" style="color: #0066FF;"></i>&nbsp;&nbsp;<span class="font-bold">ROI不符合规定</span>
					<p class="padding-10">
						本申请单ROI低于底线值，公司最低ROI为：100.0%,本申请为：0%。
					</p>
					</div>
				</div>
		</div>
		<div class="padding-10">
			本申请中：{volist name="feeda" id="fe"}{$fe['title']}:{$fe['hanshuis']}元;{/volist}总费用：{$all['hanshuis']}元。总预计销量：{$all['yesSales']}元；总费用率：{$all['feiyonglv']}；总ROI：0%；
			<!--本申请中：随货折扣费：18240.00元；总费用：18240.00元。总费用率：0.00%；总ROI:0.00%;-->
		</div>
		<div class="padding-10">
			费用申请说明：1.如未达到当月承诺未税进货金额，则促销费用按实际未税进货金额比例相应减少
		</div>
		<form action="" id="form2">
		{if empty($jc)}
			<input type="hidden" name="id" value="{$apply.id}"/>
		<div class="padding-10 text-left form-group">
			<label class="checkbox-inline" for="fankui">
				<input type="checkbox" name="sfxyfk" id="fankui" {if $apply.sfxyfk==1} checked {/if} class="" style="margin-top: 2px;">是否需要反馈
				<span class="colorRed">(如需反馈请勾选)</span>
			</label>
		</div>
		{/if}
		<div class="padding-10 text-center">
			<!--<input type="button" class="btn btn-info" value="拆分至领导审批" />
			<input type="button" class="btn btn-warning" value="打回修改" />
			<input type="button" class="btn btn-success" value="审批通过" />-->
			<button class="btn btn-primary" type="button" id="tijiao">进入下一步</button>
		</div>
		</form>
		{include file="Public/footer"}

		<script type="text/javascript">
		 $('#tijiao').click(function () {
		     var jc="{$jc}";
             if(typeof jc == "undefined" || jc == null || jc == ""||jc == 0){ //当不是进场时
                 var param = $('#form2').serialize()
                 $.post('{:url("tjsp_cg")}',param,function (data) {
                     var re=JSON.parse(data);
                     if(re['success']){
                         swal({title:"保存成功"},function () {
                             location.href='{:url("gzlsp",["workId"=>request()->param("workId"),"trackId"=>request()->param("trackId")])}'
                             return false
                         })
                     }else{
                         swal({title:re["msg"]})
                     }
                 })
             }else{
                 location.href='{:url("gzlsp",["workId"=>request()->param("workId"),"trackId"=>request()->param("trackId")])}'
                 return false
             }

	        /*location.href='{:url("gzlsp",["workId"=>request()->param("workId"),"trackId"=>request()->param("trackId")])}'
	        return false*/
	         
	    })

			$("#tabA a").click(function() {
				$(this).removeClass('btn-outline').siblings().addClass('btn-outline')
				var i = $(this).index();
				$("#tabbox .tabdiv").eq(i).addClass('tabdivActive').siblings().removeClass('tabdivActive');
			})
		</script>
	</body>

</html>